<template>
    <div id="main">
        <tab></tab>
        <div v-for="(item, i) in rooms" :key="i">
            <img :src="item.roomSrc" alt="">
            {{item.roomName}}
        </div>
        
    </div>
</template>
<script>
import tab from '@/components/tab'
export default {
    components: {
        tab
    },
    data() {
        return {
            rooms: []
        }
    },
    created() {
        this.getRooms();
    },
    methods: {

        // 获取直播列表数据的函数
        getRooms() {
            console.log(this.$route)
            this.$http.get(`room/list?page=2&type=${this.$route.params.room}`).then(res => {
                this.rooms = res.data.data.list;
            })
        }
    }
}
</script>
<style lang="scss" scoped>
    #main{
        width: 100%;
        height: 100%;
        img{
            width: 200px;
        }
    }
</style>